<extend name="Public/base" />

<block name="style">

</block>

<block name="body">
    <!-- 弹窗插件 -->
    <include file="Public:artdialog" />

    <div class="row">
        <div class="col-md-12">
            <div class="block-web">
                <!-- 商品列表 -->
				 <form action="{:U('Purchasing')}" method="post" id="SearchFrom" class="vform">
                    <div class="bgmain">
					
                        <!-- <div class="header">
                           <h3 style="float:left" class="content-header">SEO优化首页</h3>
                            <div role="presentation" class="glyphicon glyphicon-plus"><a href="__URL__/add.html">添加SEO</a></div>
                        </div> -->
                         <div class="header">
                           <!--  <div class="actions_diy">
                                <a href="__URL__/add" class="btn btn-default btn-primary">
                                    <i class="fa fa-plus"></i>添加记录
                                </a>
                            </div> -->
                            <h3 class="content-header">需求记录</h3>
                        </div>
                        <div class="block-web" style="margin: 0;padding:10px 20px 0px 0px;">
                            <div class="porlets-content">
                                <div class="row" style="margin-left:-45px;">
                                    <div class="col-md-12" style="padding-left:0px;">
                                        <div class="search_pannl_div">
                                            <table class="search_table">
		                                            <tbody>
		                                                <tr>
		                                                    <td class="single-col" >
															        <label>时间(开始)</label>
															        <input name="start_time" readonly="readonly" class="laydate-icon" style="width: 160px;padding: 0px;height: 20px;" type="text" id="start_time" size="15" value="{:I('param.start_time')}">
															        &nbsp;&nbsp;
															        时间(结束)
															        <input name="end_time" readonly="readonly" class="laydate-icon" style="width: 160px;padding: 0px;height: 20px;" type="text" id="end_time" size="15" value="{:I('param.end_time')}">
																	
		                                                          关键词：<input style="width:305px;" type="text" id="keywords" name="keywords" placeholder="输入商品货号、英文名称查找" value="{:I('param.keywords')}">
		                                                        <button type="button" class="btn btn-success" formtarget="SearchFrom" id="searchBtn" onclick="goSearch('#searchBtn','load_tb_div')"><i class="fa fa-search"></i> 搜索</button>
		                                                        <button type="button" class="btn btn-default" onclick="$('input[type=text]').val(['']);$('select').val('');goSearch('#searchBtn','load_tb_div');"> 查看所有</button>
		                                                    </td>
		                                                </tr>
		                                            </tbody>
		                                        </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
               
                <div id="load_tb_div" style="padding:10px 0px 30px ;">
				<table class="table table-striped goods_list_table   table-bordered">
        <thead>
        <tr class="text-center">
        	<th class="opth40">序号</th>
        	<th class="opth40">商品货号</th>
        	<th class="opth100">英文名称</th>
        	<th class="opth60">警告库存数量</th>
            <th class="opth60">实际库存数量</th>
            <th class="opth60">提出需求天数</th>
           <!--  <th class="opth60">添加日期</th> -->
            <th class="opth40">提出需求日期</th>
          <!--  <th class="opth40">是否有效</th>
             <th class="opth60">操作</th> -->

        </tr>
    </thead>
    <tbody id="tbodylist">
    	<foreach name="sql" item="value" key="k">
            <tr>
            	<td>{$k+1}</td>
            	<td>{$value.actual_goods_sn}</td>
            	<td>{$value.goods_englishname}</td>
            	<td>{$value.warning_stock_quantity}</td>
                <td>{$value.actual_stock_quantity}</td>
                <td>{$value.demand_time}</td>
               <!--  <td>{$value.procreq_time}</td> -->
                <td>{$value.actual_date}</td>
                <!--  <td>{$value.sactive}</td>
               <td>
                     <div class="btn-group">
					  <a class="btn btn-primary" href="#"><i class="icon-user icon-white"></i>操作</a>
					  <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
					  <ul class="dropdown-menu">
					    <li><a href="__URL__/add/procreq_id/{$value.procreq_id}"><i class="glyphicon glyphicon-pencil"></i>编辑</a></li>
					    <li><a href="__URL__/add/procreq_id/{$value.procreq_id}" onclick="return confirm('你确定删除吗？');"><i class="glyphicon glyphicon-trash"></i> 删除</a></li>
					  </ul>
			        </div>      
                </td> -->
            </tr>
        </foreach>
		<empty name="sql">
            <tr>
                <td style="padding:30px;text-align:center;" colspan="10">
                   	 暂无相关记录
                </td>
            </tr>
			<else />
			<tr>
				<td colspan="8">
				<div class="page_list_ops dataTables_paginate paging_bootstrap pagination">
					 {$show}
				</div>
				</td>
		   </tr>
        </empty>
    </tbody>
</table>
</div>
 <input type="hidden" name="listrows" id="listrows" value="{:I('param.listrows')}">			
 <input type="hidden" name="_page" id="_page" value="">
 </form>
</block>
<block name="script">
<script type="text/javascript" src="/plugins/laydate/laydate.dev.js"></script>
<script>
function goSearch(){
        $("#listrows").val("20");
		$("#SearchFrom").submit();
			  }
	laydate({
	    elem: '#start_time',
	    festival: true, //显示节日
	    istime: true,
	    format: 'YYYY-MM-DD',
		max:laydate.now(),
	});
	laydate({
	    elem: '#end_time',
	    festival: true, //显示节日
	    istime: true,
	    format: 'YYYY-MM-DD',
		max:laydate.now(),
	});
     function inputGoToPages(listrows){
			    var page=$(listrows).val();
				$("#listrows").val(page);
				$("#SearchFrom").submit();
			 }
			 
			 function selectGoToPages(page){
			    var _page=$(page).val();
			    $("#_page").val(_page);
				$("#SearchFrom").submit();
			 }
</script>
</block>
